home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-10-12 | 2.2 KB | 116 lines | [TEXT/ttxt] |
- !
- ! InterSLIP gateway script for 3Com terminal server
- !
- ! Label 99 is the general purpose error handler, which beeps
- ! and pauses long enough for the user to read the message.
- !
- ! First, we wait for the user name prompt
- !
- @originate
- note "Waiting for prompt"
- pause 100
- write "\13"
- matchclr
- matchstr 1 1 "NetLogin:"
- matchread 50
- note "No NetLogin prompt"
- jump 99
- !
- ! Now, send the user name and wait for the password prompt
- !
- @label 1
- note "Sending user name"
- write "^5\13"
- note "Waiting for Password"
- matchclr
- matchstr 1 2 "Password:"
- matchread 50
- note "No password prompt"
- jump 99
- !
- ! Send the password and wait for either the terminal server
- ! prompt or an error message
- !
- @label 2
- note "Sending password"
- write "^6\13"
- Note "Waiting for > prompt"
- pause 10
- matchclr
- matchstr 1 4 ">"
- matchstr 2 3 "Incorrect"
- matchread 260
- jump 99
- !
- ! If we got an error message, notify the user and fail
- !
- @label 3
- note "Accessed Denyed"
- pause 10
- jump 99
- !
- ! General purpose error handler. Let the message appear,
- ! beep, and then pause for a second.
- !
- @label 99
- pause 1
- sound
- pause 60
- exit -1
- !
- ! If we've successfully logged in, ask for SLIP mode and
- ! wait for the response. If we get anything except
- ! "Entering SLIP mode.", assume something went wrong, and fail.
- !
- @label 4
- note "Requesting SLIP; conn"
- write "cslip\13"
- matchclr
- matchstr 1 5 "conn"
- !matchstr 2 5 "IP"
- matchread 360
- note "Cannot invoke SLIP mode"
- jump 99
- !
- ! We've entered SLIP mode, so match on the first thing that
- ! looks like an IP address. If we don't find one, fail.
- !
- @label 5
- note "Checking for IP Address"
- matchclr
- matchexp 1 6 "[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]"
- matchread 360
- note "No IP address given"
- jump 99
- !
- ! We've found an IP address, so inform MacTCP of it, and
- ! watch for a number (the MTU size).
- !
- @label 6
- setip "^0"
- !matchclr
- !matchexp 1 7 "[0-9][0-9]*"
- !matchread 120
- !note "No MTU value"
- !jump 99
- !
- ! We found the MTU size, so inform MacTCP and exit
- ! the script successfully.
- !
- !@label 7
- setmtu "1500"
- !setmtu "^0"
- !setmtu "1009"
- exit 0
- !
- ! Answer and Hangup modes are currently unused in gateway
- ! scripts, but just for future compatibility, exit successfully.
- !
- @answer
- @hangup
- write "+++"
- write "ath0"
- exit 0
-
-
-